<?php

namespace YmPhp\Admin\Models;

use YmPhp\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\SoftDeletes;
use YmPhp\Admin\Traits\ModelTree;
class District extends BasicModel
{
//	use HasDateTimeFormatter;
//    use SoftDeletes;
    use ModelTree;
    protected $table = 'district';

    protected $titleColumn = 'name';

    protected $orderColumn = 'sort';

    protected $parentColumn = 'pid';


    /**
     * 获取一级地区
     * @param $pid
     * @return mixed
     */
    public function getArea($pid = 0) {
        $area = self::where('id', $pid)->get();
        return $area;

    }

}
